Skip to content

Conversation

@willbouch
Copy link
Contributor

@willbouch willbouch commented Oct 28, 2025

See PR here for server-side changes.

This PR focuses on the admin dashboard. Il will go over what is done and what is missing (which will come in next couple of PRs). I wanted a functional thing first since the PRs are already very big and I will expand on the feature in small additions in the next PRs.

Options dashboard

CleanShot 2025-11-10 at 12 10 11@2x

There is now a section to manage the product options of the medusa project. By default, after running the migration, every option you had should be set to Exclusive = true. This means that those product options will not be treated as Global, which are the ones a user could filter by in a storefront or can be linked to other products.

Option creation

CleanShot.2025-11-05.at.13.55.02.mp4

Options can be created in a very similar manner to the one we had at the product creation level. Users input the name and the list of values and can now manage the ordering of those options.

Option edit

CleanShot.2025-11-05.at.13.57.07.mp4

Very similar to the option creation.

Product creation

CleanShot.2025-11-05.at.13.59.23.mp4

It is also possible at product creation to assign existing global options

Note: This section will change the most. Here is what is missing:

  • Ability to only assign a subset of the values to a given product. In other words, if I choose Size and only want L and XL, I will be able to do it (right now, all the values are associated to the product
  • Ability to create options directly from that page. Those options will be treated as "ad hoc" options (exclusive)
  • Ability to add values to existing global options. For example, if I want to associate my product with the Size option but I would like to add the value XS, I would do it from that page directly rather than going to the options edit page

Note

Introduce a full Product Options section in the admin (list/detail/create/edit/metadata), add SDK support and product option linking, integrate global options into product creation and product detail, and expose new widget zones and i18n.

  • Admin Dashboard
    • Navigation & Routes: Add Product Options top-level nav and full route tree (/product-options list, create, detail, edit, metadata). Remove old per-product option create/edit routes; add products/:id/options/manage.
    • Product Options UI: New list table (filters, status badges), detail view (values, associated products), create/edit forms with value ranking, metadata editor, and delete flow.
    • Products Integration:
      • Product creation: select/link existing global options, choose option values, auto-generate variant permutations; schema/utils accept option ids.
      • Product detail: new “Manage Product Options” drawer to associate/disassociate options; edit action points to global option edit.
    • Hooks: Add useProductOption(s) + mutations (create/update/delete), useLinkProductOptions; update product hooks accordingly.
    • Tables/Filters: Add product-option table columns, filters, and query helpers.
    • i18n: Extend schema and en.json with Product Options strings, general labels (exclusive/global), and actions.
  • Admin Shared
    • Add product_option.* injection zones and include in global INJECTION_ZONES.
  • JS SDK
    • New admin.productOption resource (create/retrieve/list/update/delete).
    • admin.product.linkOptions(productId, { add, remove }) for associating options with products.

Written by Cursor Bugbot for commit 91de56f. This will update automatically on new commits. Configure here.

@changeset-bot
Copy link

changeset-bot bot commented Oct 28, 2025

🦋 Changeset detected

Latest commit: 91de56f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 74 packages
Name Type
@medusajs/admin-shared Major
@medusajs/dashboard Major
@medusajs/js-sdk Major
@medusajs/admin-bundler Major
@medusajs/admin-sdk Major
@medusajs/admin-vite-plugin Major
@medusajs/draft-order Major
@medusajs/medusa Major
@medusajs/test-utils Major
@medusajs/medusa-oas-cli Major
integration-tests-http Patch
@medusajs/analytics Major
@medusajs/api-key Major
@medusajs/auth Major
@medusajs/caching Major
@medusajs/cart Major
@medusajs/currency Major
@medusajs/customer Major
@medusajs/file Major
@medusajs/fulfillment Major
@medusajs/index Major
@medusajs/inventory Major
@medusajs/link-modules Major
@medusajs/locking Major
@medusajs/notification Major
@medusajs/order Major
@medusajs/payment Major
@medusajs/pricing Major
@medusajs/product Major
@medusajs/promotion Major
@medusajs/region Major
@medusajs/sales-channel Major
@medusajs/settings Major
@medusajs/stock-location Major
@medusajs/store Major
@medusajs/tax Major
@medusajs/user Major
@medusajs/workflow-engine-inmemory Major
@medusajs/workflow-engine-redis Major
@medusajs/oas-github-ci Major
@medusajs/cache-inmemory Major
@medusajs/cache-redis Major
@medusajs/event-bus-local Major
@medusajs/event-bus-redis Major
@medusajs/analytics-local Major
@medusajs/analytics-posthog Major
@medusajs/auth-emailpass Major
@medusajs/auth-github Major
@medusajs/auth-google Major
@medusajs/caching-redis Major
@medusajs/file-local Major
@medusajs/file-s3 Major
@medusajs/fulfillment-manual Major
@medusajs/locking-postgres Major
@medusajs/locking-redis Major
@medusajs/notification-local Major
@medusajs/notification-sendgrid Major
@medusajs/payment-stripe Major
@medusajs/core-flows Major
@medusajs/framework Major
@medusajs/modules-sdk Major
@medusajs/orchestration Major
@medusajs/types Major
@medusajs/utils Major
@medusajs/workflows-sdk Major
@medusajs/cli Major
@medusajs/deps Major
@medusajs/telemetry Major
@medusajs/icons Major
@medusajs/toolbox Major
@medusajs/ui-preset Major
create-medusa-app Major
medusa-dev-cli Major
@medusajs/ui Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Oct 28, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
api-reference Building Building Preview Comment Nov 14, 2025 2:57pm
7 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
api-reference-v2 Ignored Ignored Preview Nov 14, 2025 2:57pm
cloud-docs Ignored Ignored Preview Nov 14, 2025 2:57pm
docs-ui Ignored Ignored Preview Nov 14, 2025 2:57pm
docs-v2 Ignored Ignored Preview Nov 14, 2025 2:57pm
medusa-docs Ignored Ignored Preview Nov 14, 2025 2:57pm
resources-docs Ignored Ignored Preview Nov 14, 2025 2:57pm
user-guide Ignored Ignored Preview Nov 14, 2025 2:57pm

@willbouch willbouch changed the base branch from develop to chore/add-many-to-many-between-product-and-option October 28, 2025 18:06
@willbouch willbouch force-pushed the feat/product-option-redesign-frontend branch from f3d5c5d to 394de22 Compare October 31, 2025 18:54
@willbouch willbouch changed the title WIP - feat(dashboard,js-sdk): product option redesign (client-side) feat(dashboard,js-sdk): product option redesign (client-side) Nov 5, 2025
@willbouch willbouch changed the title feat(dashboard,js-sdk): product option redesign (client-side) feat(dashboard,admin-shared): product option redesign (client-side) Nov 5, 2025
@willbouch
Copy link
Contributor Author

/snapshot-this

@willbouch
Copy link
Contributor Author

/snapshot-this

@willbouch willbouch force-pushed the feat/product-option-redesign-frontend branch from 2db3cb1 to 2fdf3ae Compare November 6, 2025 16:43
@willbouch
Copy link
Contributor Author

/snapshot-this

@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2025

🚀 A snapshot release has been made for this PR

Test the snapshots by updating your package.json with the newly published versions:

yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]

Latest commit: 01a5ce9

@willbouch willbouch marked this pull request as ready for review November 6, 2025 18:29
@willbouch willbouch requested a review from a team as a code owner November 6, 2025 18:29
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the final PR Bugbot will review for you during this billing cycle

Your free Bugbot reviews will reset on November 17

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@willbouch
Copy link
Contributor Author

@fPolic @olivermrbl @NicolasGorga @adrien2p This would be the PR to actually test from the snapshot :)

@willbouch willbouch force-pushed the feat/product-option-redesign-frontend branch from 4fb1a9f to 30af643 Compare November 7, 2025 17:46
@willbouch willbouch marked this pull request as draft November 10, 2025 15:10
@willbouch willbouch marked this pull request as ready for review November 13, 2025 20:12
// New option - select all values by default
newSelectedValues[option.id] = option.values?.map((v) => v.id) || []
}
})
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Option Validation Blocks Product Creation

When a user deselects all product options in the product creation form, handleProductOptionSelect is called with an empty array. This results in selectedProductOptions being empty, which leads to form.setValue("options", []) being called with an empty array at line 246. However, the schema requires options to have at least one item (z.array(ProductCreateOptionSchema).min(1) in constants.ts line 87). This causes a validation error preventing product creation when all options are deselected, even though variants are enabled.

Fix in Cursor Fix in Web

@willbouch willbouch changed the title feat(dashboard,admin-shared): product option redesign (client-side) feat(dashboard,admin-shared,js-sdk): product option redesign (client-side) Nov 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants